<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Mapache: Referencia de la Clase TCPSocket</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generado por Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "../../search",false,'Buscar');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../Mapache.png"></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Mapache&#160;<span id="projectnumber">v1.0.0</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Página&#160;principal</span></a></li>
      <li class="current"><a href="../../annotated.html"><span>Clases</span></a></li>
      <li><a href="../../files.html"><span>Archivos</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Buscar" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../annotated.html"><span>Lista&#160;de&#160;clases</span></a></li>
      <li><a href="../../classes.html"><span>Índice&#160;de&#160;clases</span></a></li>
      <li><a href="../../inherits.html"><span>Jerarquía&#160;de&#160;la&#160;clase</span></a></li>
      <li><a href="../../functions.html"><span>Miembros&#160;de&#160;las&#160;clases</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('dd/d10/classTCPSocket.html','../../');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Métodos públicos</a> &#124;
<a href="#pro-attribs">Atributos protegidos</a> &#124;
<a href="#pri-attribs">Atributos privados</a>  </div>
  <div class="headertitle">
<h1>Referencia de la Clase TCPSocket</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="TCPSocket" -->
<p><code>#include &lt;TCPSocket.h&gt;</code></p>
<div class="dynheader">
Diagrama de colaboración para TCPSocket:</div>
<div class="dyncontent">
<div class="center"><img src="../../d6/d0c/classTCPSocket__coll__graph.png" border="0" usemap="#TCPSocket_coll__map" alt="Collaboration graph"/></div>
<map name="TCPSocket_coll__map" id="TCPSocket_coll__map">
</map>
<center><span class="legend">[<a target="top" href="../../graph_legend.html">significado de colores y flechas</a>]</span></center></div>

<p><a href="../../dc/d26/classTCPSocket-members.html">Lista de todos los miembros.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Métodos públicos</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a7a50427a401d1a6f3209d51818bad901">TCPSocket</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#af357e6923a0f8adbbb8e46fab4523991">~TCPSocket</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a6d2efb4f9179b90860994ab1a69406d5">bindear</a> (int puerto)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a313dddefda786db1d0c1f83b9ef9697d">escuchar</a> (int max_cola_conexiones)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#aae53264bfc0397443e750649828e5f58">conectar</a> (const std::string &amp;<a class="el" href="../../dd/d10/classTCPSocket.html#afac24afbf950449b1c71701fde978486">ip</a>, int puerto)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a673e5ea670d221b9385241dd4459c8a1">apagar</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#ac69e30e7c478215652cf9e36f039e260">cerrar</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dd/d10/classTCPSocket.html">TCPSocket</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a7e2dd0e88d503cbc41c82330a64f8df4">aceptar</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a2c6a999235f22bdc25cf62a2dec8213f">enviar</a> (char *data, int longitud)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a23ce5b78255bac6ce60f0e1fd90cca82">recibir</a> (char *data, int longitud)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a8ffde50d2ca5ab7854a03a5110827d40">getIp</a> () const </td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Atributos protegidos</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#a4138d1c265809c9b74e3a0be460d55a4">descriptor</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#ae4c74eb128e546de2162887c96735459">creado</a></td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Atributos privados</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d10/classTCPSocket.html#afac24afbf950449b1c71701fde978486">ip</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Descripción detallada</h2>
<div class="textblock"><p>Clase utilizada para abstraer el comportamiento de los sockets de c. </p>
</div><hr/><h2>Documentación del constructor y destructor</h2>
<a class="anchor" id="a7a50427a401d1a6f3209d51818bad901"></a><!-- doxytag: member="TCPSocket::TCPSocket" ref="a7a50427a401d1a6f3209d51818bad901" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TCPSocket::TCPSocket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor. </p>

</div>
</div>
<a class="anchor" id="af357e6923a0f8adbbb8e46fab4523991"></a><!-- doxytag: member="TCPSocket::~TCPSocket" ref="af357e6923a0f8adbbb8e46fab4523991" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TCPSocket::~TCPSocket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Destructor. </p>

<p><div class="dynheader">
Gráfico de llamadas para esta función:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d10/classTCPSocket_af357e6923a0f8adbbb8e46fab4523991_cgraph.png" border="0" usemap="#dd/d10/classTCPSocket_af357e6923a0f8adbbb8e46fab4523991_cgraph" alt=""/></div>
<map name="dd/d10/classTCPSocket_af357e6923a0f8adbbb8e46fab4523991_cgraph" id="dd/d10/classTCPSocket_af357e6923a0f8adbbb8e46fab4523991_cgraph">
<area shape="rect" id="node3" href="../../dd/d10/classTCPSocket.html#ac69e30e7c478215652cf9e36f039e260" title="TCPSocket::cerrar" alt="" coords="229,5,360,35"/></map>
</div>
</p>

</div>
</div>
<hr/><h2>Documentación de las funciones miembro</h2>
<a class="anchor" id="a7e2dd0e88d503cbc41c82330a64f8df4"></a><!-- doxytag: member="TCPSocket::aceptar" ref="a7e2dd0e88d503cbc41c82330a64f8df4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dd/d10/classTCPSocket.html">TCPSocket</a> * TCPSocket::aceptar </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Valido solo para sockets que fueron bindeados y que estan escuchando.</p>
<p>Acepta una nueva conexion desde la cola de conexiones. </p>
<dl class="return"><dt><b>Devuelve:</b></dt><dd>TCPSocket* es el socket del nuevo cliente aceptado. </dd></dl>

<p><div class="dynheader">
Gráfico de llamadas para esta función:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d10/classTCPSocket_a7e2dd0e88d503cbc41c82330a64f8df4_cgraph.png" border="0" usemap="#dd/d10/classTCPSocket_a7e2dd0e88d503cbc41c82330a64f8df4_cgraph" alt=""/></div>
<map name="dd/d10/classTCPSocket_a7e2dd0e88d503cbc41c82330a64f8df4_cgraph" id="dd/d10/classTCPSocket_a7e2dd0e88d503cbc41c82330a64f8df4_cgraph">
<area shape="rect" id="node3" href="../../dd/d10/classTCPSocket.html#a7a50427a401d1a6f3209d51818bad901" title="TCPSocket::TCPSocket" alt="" coords="196,5,361,35"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a673e5ea670d221b9385241dd4459c8a1"></a><!-- doxytag: member="TCPSocket::apagar" ref="a673e5ea670d221b9385241dd4459c8a1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::apagar </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Le indica al socket que debe dejar de emitir y recibir datos. </p>

</div>
</div>
<a class="anchor" id="a6d2efb4f9179b90860994ab1a69406d5"></a><!-- doxytag: member="TCPSocket::bindear" ref="a6d2efb4f9179b90860994ab1a69406d5" args="(int puerto)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::bindear </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>puerto</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Le indica al socket cual será la dirección donde escuchará las nuevas conexiones. </p>
<dl><dt><b>Parámetros:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">puerto</td><td>es puerto donde escuchará las conexiones. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac69e30e7c478215652cf9e36f039e260"></a><!-- doxytag: member="TCPSocket::cerrar" ref="ac69e30e7c478215652cf9e36f039e260" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::cerrar </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Cierra el socket </p>

</div>
</div>
<a class="anchor" id="aae53264bfc0397443e750649828e5f58"></a><!-- doxytag: member="TCPSocket::conectar" ref="aae53264bfc0397443e750649828e5f58" args="(const std::string &amp;ip, int puerto)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::conectar </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>ip</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>puerto</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Conecta al socket con la dirección indicada y el puerto indicado. </p>
<dl><dt><b>Parámetros:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ip</td><td>es el puerto donde se desea conectar </td></tr>
    <tr><td class="paramname">puerto</td><td>es el puerto donde se desea conectar </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2c6a999235f22bdc25cf62a2dec8213f"></a><!-- doxytag: member="TCPSocket::enviar" ref="a2c6a999235f22bdc25cf62a2dec8213f" args="(char *data, int longitud)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::enviar </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>longitud</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Envia la cantidad de bytes indicada por longitud a partir de la posicion indicada por data </p>
<dl><dt><b>Parámetros:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>direccion desde donde tomar los datos </td></tr>
    <tr><td class="paramname">longitud</td><td>es el tamaño de los datos que se deben transmitir </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a313dddefda786db1d0c1f83b9ef9697d"></a><!-- doxytag: member="TCPSocket::escuchar" ref="a313dddefda786db1d0c1f83b9ef9697d" args="(int max_cola_conexiones)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::escuchar </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max_cola_conexiones</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Le indica al sistema operativo que el socket debe empezar a recibir conexiones entrantes. </p>
<dl><dt><b>Parámetros:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">max_cola_conexiones</td><td>es para indicar que tamaño máximo tendrá la cola de conexiones entrantes. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8ffde50d2ca5ab7854a03a5110827d40"></a><!-- doxytag: member="TCPSocket::getIp" ref="a8ffde50d2ca5ab7854a03a5110827d40" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string TCPSocket::getIp </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Devuelve el ip del socket </p>
<dl class="return"><dt><b>Devuelve:</b></dt><dd>ip del socket </dd></dl>

</div>
</div>
<a class="anchor" id="a23ce5b78255bac6ce60f0e1fd90cca82"></a><!-- doxytag: member="TCPSocket::recibir" ref="a23ce5b78255bac6ce60f0e1fd90cca82" args="(char *data, int longitud)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPSocket::recibir </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>longitud</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Documentación de los datos miembro</h2>
<a class="anchor" id="ae4c74eb128e546de2162887c96735459"></a><!-- doxytag: member="TCPSocket::creado" ref="ae4c74eb128e546de2162887c96735459" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../dd/d10/classTCPSocket.html#ae4c74eb128e546de2162887c96735459">TCPSocket::creado</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a4138d1c265809c9b74e3a0be460d55a4"></a><!-- doxytag: member="TCPSocket::descriptor" ref="a4138d1c265809c9b74e3a0be460d55a4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="../../dd/d10/classTCPSocket.html#a4138d1c265809c9b74e3a0be460d55a4">TCPSocket::descriptor</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="afac24afbf950449b1c71701fde978486"></a><!-- doxytag: member="TCPSocket::ip" ref="afac24afbf950449b1c71701fde978486" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="../../dd/d10/classTCPSocket.html#afac24afbf950449b1c71701fde978486">TCPSocket::ip</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>La documentación para esta clase fue generada a partir de los siguientes ficheros:<ul>
<li>Mapache/src/common/sockets/<a class="el" href="../../df/df8/TCPSocket_8h.html">TCPSocket.h</a></li>
<li>Mapache/src/common/sockets/<a class="el" href="../../dd/dac/TCPSocket_8cpp.html">TCPSocket.cpp</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="../../dd/d10/classTCPSocket.html">TCPSocket</a>      </li>
      <li class="footer">Generado el Domingo, 20 de Noviembre de 2011 00:38:06 para Mapache por&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Todo</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Clases</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Archivos</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funciones</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>&apos;defines&apos;</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


</body>
</html>
